package com.region.plugin.proxy.javassist;

import com.region.plugin.Interceptor;
import com.region.plugin.proxy.AbstractRealProxy;
import javassist.util.proxy.MethodHandler;

import java.lang.reflect.Method;

/**
 * @author liujieyu
 * @date 2024/11/6 11:08
 * @desciption
 */
public class JavassistRealProxy extends AbstractRealProxy implements MethodHandler {


    public JavassistRealProxy(Object target, Interceptor interceptor) {
        super(target, interceptor);
    }

    @Override
    public Object invoke(Object o, Method method, Method proceed, Object[] objects) throws Throwable {
        return executeProceed(interceptor, new JavassistProceedPoint(o, proceed, objects));
    }
}
